Skip to content

fix(validation): open signed PDF by UUID instead of the owner's nodeIdFixes #9103 - #9104

Merged
vitormattos merged 9 commits into
LibreSign:mainfrom
oPeras1:fix/validation-open-signed-pdf
Oct 20, 2026
Merged

vitormattos merged 9 commits into
LibreSign:mainfrom
oPeras1:fix/validation-open-signed-pdf

Conversation

@oPeras1

@oPeras1 oPeras1 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Resolves: #9103

📝 Summary

On the validation page, "Open file" / "View PDF" passed the file owner's original nodeId to OCA.Viewer for logged-in users. Viewer handlers that resolve fileid in the current user's filesystem (Euro-Office, ONLYOFFICE) then:

  • showed the owner the unsigned original instead of the signed PDF;
  • failed with {"error":"File not found"} for signers and other logged-in users.

This PR makes the validation page always open the signed PDF by UUID (/apps/libresign/p/pdf/<uuid>), as it already does for anonymous visitors. openDocument now only uses OCA.Viewer when a nodeId is explicitly given, so other callers (Files list, sidebar, ID docs, settings) are unchanged.

The change is frontend only. The backend route already resolves the storage owner from the UUID and serves the signed file.

🧪 How to test

  1. Install Euro-Office (or ONLYOFFICE) and enable PDF as a default format in its admin settings.
  2. As user X, request signatures from Nextcloud users Y and Z without sharing the file. Have both sign.
  3. Open /apps/libresign/validation/<uuid> and click "Open file":
    • as X: the signed PDF opens (before: unsigned original);
    • as Y, and as an unrelated logged-in user W: the signed PDF opens (before: "File not found");
    • logged out: the signed PDF still opens.
  4. Optional: repeat with PDF not set as a Euro-Office default. Behaviour is the same.
  5. Optional: for an envelope, check that "View PDF" on each file opens that file's signed PDF.

Validation evidence

  • Focused regression/acceptance test
  • Relevant lint/type/static-analysis checks
  • Broader suite required by the changed surface
  • CI reviewed

🎨 UI / Front-end changes

  • The validation page opens the signed PDF by UUID for every visitor.
  • Logged-in users now get the PDF in a new tab instead of the Viewer overlay, as anonymous users already do on main. The Viewer picks its handler by MIME type, and some handlers need a node the user can access, so it can't be used safely here.
  • In EnvelopeValidation, "View PDF" is shown when a file has a uuid, instead of requiring nodeId.

🚧 Tasks

  • Manual check with Euro-Office as the default PDF viewer (owner, signer, unrelated user, anonymous)

✅ Checklist

  • I have read and followed the contribution guide.
  • The diff does not contain unrelated refactors or generated changes.
  • Commits follow Conventional Commits where applicable.
  • All commits include the required DCO sign-off.

🤖 AI (if applicable)

  • Only the tests suite was generated using AI;

@oPeras1
oPeras1 requested a review from a team as a code owner October 17, 2026 19:01
Copilot AI balanced review requested due to automatic review settings October 17, 2026 19:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@oPeras1
oPeras1 force-pushed the fix/validation-open-signed-pdf branch from 25f1d8c to 73d761e Compare October 17, 2026 20:34
vitormattos
vitormattos previously approved these changes Oct 20, 2026
Signed-off-by: oPeras1 <hugo.pereira@rnl.tecnico.ulisboa.pt>
@vitormattos
vitormattos force-pushed the fix/validation-open-signed-pdf branch from 73d761e to 5b09ae4 Compare October 20, 2026 01:42
@vitormattos

Copy link
Copy Markdown
Member

@oPeras1 I'll wait a bit before merge this PR because I found other points to fix.

@oPeras1

oPeras1 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Np, thanks!

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>

Copy link
Copy Markdown
Member

/backport to stable33

Copy link
Copy Markdown
Member

/backport to stable34

@backportbot-libresign backportbot-libresign Bot added the backport-request Request to backport a change to supported stable branches label Oct 20, 2026
@vitormattos

Copy link
Copy Markdown
Member

/backport to stable35

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
vitormattos merged commit e045216 into LibreSign:main Oct 20, 2026
63 of 64 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Hi @oPeras1, your first pull request to LibreSign has been merged. 🎉

Your work is part of LibreSign now, and everyone who signs a document with it benefits from the time and knowledge you shared. Thank you.

You are very welcome to contribute again. The good first issue list is a good place to look next, and you no longer have to wonder how the process works.

If you have a few minutes and feel like it, we would love to hear how this went for you: https://ls.librecode.coop/index.php/645932?lang=en&source=github-first-merged-pr&repository=libresign. It is entirely optional; nothing is expected of you in return for contributing.

Come say hello in the LibreSign community: https://t.me/LibreSign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Open file" on the validation page fails when Euro-Office/ONLYOFFICE is the default PDF viewer

3 participants